<?php

declare(strict_types=1);

namespace DreamCat\StateMachineTest\Cases\Config;

use DreamCat\StateMachine\Factory\ConfigParseFactory;
use PHPUnit\Framework\TestCase;
use RuntimeException;

/**
 * 配置解析工厂测试用例
 * @author vijay
 */
class ParseFactoryTest extends TestCase
{
    /**
     * 测试工厂没对应文件的异常
     * @return void
     */
    public function testNoFile(): void
    {
        $fileName = uniqid("noFile");
        $this->expectException("路径 {$fileName} 即不是文件也不是目录");
        $this->expectException(RuntimeException::class);
        ConfigParseFactory::getConfigParser($fileName);
    }
}

# end of file
